import cv2
import matplotlib.pyplot as plt
import numpy as np

# import pycocotools.mask as mask_util
# from PIL import Image

# mask_threth = 50

# img = cv2.imread('/home/st/ubuntu_data/dataset/VOC/VOCdevkit/VOC2012/JPEGImages/2007_000027.jpg')

# # binary mask
# coordinates = [[[40, 135], [168,132], [164,330], [2,328]]]
# coordinates = np.array(coordinates)
# mask = np.zeros(img.shape[:2], dtype=np.int8)
# mask = cv2.fillPoly(mask, coordinates, 255)
# bbox_mask = (mask > mask_threth).astype(np.uint8)

# # draw the masked image
# color_mask = np.random.randint(0, 256, (1, 3), dtype=np.uint8)
# color_mask = np.array([0, 215, 255], dtype=np.uint8)
# bbox_mask = bbox_mask.astype(np.bool)
# img[bbox_mask] = img[bbox_mask] * 0.5 + color_mask * 0.5
# print("my debug image", img.shape)
# print("my debug mask", bbox_mask.shape)
# img = img[:,:,::-1]
# cv2.imshow("mask image", img)
# cv2.waitKey(0)
# # plt.imshow(img)
# # # plt.savefig('./result.png')
# # plt.show()

# #create a  balck image
# img = np.zeros((2105,1487,3), np.uint8)

img2 = cv2.imread('/media/st/Application/Ubuntu/dataset/tj/1019/img/1019/training/temp.jpg')
cv2.imshow("test img",img2)
cv2.waitKey(0)